home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
c't freeware shareware 2001 January
/
CT_SW0101.ISO
/
pc
/
software
/
kommunik
/
email
/
emailmer.sit
/
Email Merge 2.0.1
/
Email Merge
/
stack_-1.xml
< prev
next >
Wrap
Extensible Markup Language
|
2001-02-19
|
17KB
|
24 lines
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in</name>
<id>-1</id>
<cardCount>5</cardCount>
<cardID>3850</cardID>
<listID>2351</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>480</width>
<height>320</height>
</cardSize>
<script>-- All code within this stack is © Sig Softwareon openstackglobal _EMFdirty, _EMFfile, _EMfontsif the number of cards in this stack is not 5 thenanswer "The Email Merge application seems to be corrupted. Please download a new version from http://www.sigsoftware.com/"&return&return&¬"Also, if you are able, please email this application to us for diagnosis at support@sigsoftware.com"&return&return&"We are sorry for any inconvenience." with "Quit"if the optionkey is not down thendomenu "Quit HyperCard"end ifelse if not CheckGestalts() thenanswer "Email Merge requires System 7 or later, which can be purchased from any Apple stockist." with "Quit"lock messagesdomenu "Quit HyperCard"elseput menu "Font" into _EMfontscreateenvironmentInitialiseApplicationShowAboutBoxput (DictionaryItems()>0) into _EMFdirtyemptymergeset the cursor to arrowset the textarrows to trueAboutTimeoutend ifend openstackon createenvironmentset the cursor to watchset the userlevel to 2delete menuitem "-2" of menu "Edit"delete menuitem "New Card" of menu "Edit"delete menuitem "Delete Card" of menu "Edit"delete menu "Go"delete menu "Font"delete menu "Style"set the name of menuitem 1 of menu "Apple" to "About Email Merge..."set the menumessage of menuitem 1 of menu "Apple" to "aboutemailmerge"put "New"&return&"Open..."&return&"-"&return&"Save"&return&¬"Save As..."&return&"-"&return&"Import..."&return&"Export..."&return&¬"-"&return&"Edit Data..."&return&"Edit Template..."&return&¬"Preview / Send..."&return&"-"&return&"Quit" into menu "File"put "-"&return&"Select Font..." after menu "Edit"set the menumessage of menuitem "Quit" of menu "File" to "quitmerge"set the commandchar of menuitem "Quit" of menu "File" to "Q"set the menumessage of menuitem "New" of menu "File" to "get newmerge()"set the commandchar of menuitem "New" of menu "File" to "N"set the menumessage of menuitem "Open..." of menu "File" to "openmerge"set the commandchar of menuitem "Open..." of menu "File" to "O"set the menumessage of menuitem "Save" of menu "File" to "get savemerge()"set the commandchar of menuitem "Save" of menu "File" to "S"set the menumessage of menuitem "Save As..." of menu "File" to "get savemergeas()"set the menumessage of menuitem "Import..." of menu "File" to¬"go to card ""e&"import""eset the commandchar of menuitem "Import..." of menu "File" to "I"set the menumessage of menuitem "Export..." of menu "File" to¬"doexport"set the commandchar of menuitem "Export..." of menu "File" to "E"set the menumessage of menuitem "Edit Data..." of menu "File" to¬"go to card ""e&"data""eset the commandchar of menuitem "Edit Data..." of menu "File" to "D"set the menumessage of menuitem "Edit Template..." of menu "File" to¬"go to card ""e&"message""eset the commandchar of menuitem "Edit Template..." of menu "File" to "T"set the menumessage of menuitem "Preview / Send..." of menu "File" to¬"go to card ""e&"merge""eset the commandchar of menuitem "Preview / Send..." of menu "File" to "P"set the menumessage of menuitem "Select Font..." of menu "Edit" to "selectfont"end createenvironmenton commandkeydown keyif key is "q" then quitmergeelse if key is "`" and "Sig Software" is in the address thenask "Do what?"do itelse pass commandkeydownend commandkeydownon keydown keyget chartonum(key)put the selectedchunk into cput the selectedloc into lput the selectedfield into fif f is not empty thenif it is 1 then -- homeset the scroll of the selectedfield to 0do "select char 1 to 0 of"&&felse if it is 4 then -- endset the scroll of the selectedfield to 32000do "select char 32000 to 31999 of"&&felse if it is 11 or it is 12 then -- page up, page downput the textheight of the selectedfield into tput the height of the selectedfield into hput t*((h div t)-1) into sif it is 11 then put -s into sput the scroll of the selectedfield into oset the scroll of the selectedfield to o+sdo "put the scroll of"&&f&&"into r"if ((r-o) div t) is 0 then -- hasn't scrolled enoughdo "select"&&celsesubtract trunc(t/2) from item 2 of lclick at lend ifelse if it is 127 then -- delete forwardif the selectedtext is empty thenput word 2 of the selectedchunk into wput the selectedfield into fdo "delete char"&&w&&"of"&&fdo "select char"&&w&&"to"&&(w-1)&&"of"&&felse delete the selectedchunkelse pass keydownelse pass keydownend keydownon mousedoubleclicksend mousedown to the targetsend mouseup to the targetend mousedoubleclickon ccreateenvironmentend con eset the userlevel to 5reset menubarend eon closestackKillApplicationend closestackon memoryalertanswer "Email Merge has run out of memory."end memoryalerton mouseenterif the hilite of bg btn "popup" then showpopuphelpend mouseenteron aboutemailmergeShowAboutBoxWaitForAboutend aboutemailmergeon selectfontglobal _EMfontsput the number of lines in char 1 to¬offset((the textfont of cd fld "message" of cd "message")&return, _EMfonts) of _EMfonts into hget showlist(_EMfonts, "Select a font for the database and message:", false, true, "OK^,Cancel", h)if line 1 of it is "OK" thenput line (line 2 of it) of _EMfonts into newfontset the textfont of cd fld "fields" of cd "import" to newfontset the textfont of cd fld "data" of cd "import" to newfontset the textfont of cd fld "field names" of cd "data" to newfontset the textfont of cd fld "data" of cd "data" to newfontset the textfont of cd fld "edit" of cd "data" to newfontset the textfont of cd fld "subject" of cd "message" to newfontset the textfont of cd fld "to" of cd "message" to newfontset the textfont of cd fld "cc" of cd "message" to newfontset the textfont of cd fld "bcc" of cd "message" to newfontset the textfont of cd fld "message" of cd "message" to newfontset the textfont of cd fld "preview" of cd "merge" to newfontend ifend selectfonton showpopuphelpget the selectedchunkput the selectedfield into fput the last line of the script of the target into bg fld "help"if f is not empty then show fselect itend showpopuphelpon resetpopuphelpput "Click for help. Email Merge 2.0.1 © Sig Software — http://www.sigsoftware.com/" into bg fld "help"end resetpopuphelpfunction replacemerge text, flds, data, numput "Message.Number"&return&"Short.Date"&return&"Long.Date"&return&"Current.Time"&return before fldsput numtochar(255) into delimput num&delim&the short date&delim&the long date&delim&the time&delim before dataset the itemdelimiter to delimrepeat with l=1 to the number of lines in fldsrepeatput offset("«"&line l of flds&"»", text) into offif off is 0 then exit repeatput item l of data into char off to off+length(line l of flds)+1 of textend repeatend repeatset the itemdelimiter to commareturn textend replacemergeon InitialiseApplicationget EmailMergeExternals("Init")end InitialiseApplicationon KillApplicationget EmailMergeExternals("Kill")end KillApplicationfunction CheckGestaltsreturn EmailMergeExternals("Gest")end CheckGestaltsfunction IsRegisteredreturn EmailMergeExternals("Regd")-- please don't waste your time hacking this - it's thoroughly checked in external code anywayend IsRegisteredon DictionaryClearget EmailMergeExternals("Cler")end DictionaryClearfunction DictionaryItemsreturn EmailMergeExternals("Itms")end DictionaryItemsfunction DictionaryRead itemreturn EmailMergeExternals("Read", , item-1)end DictionaryReadfunction DictionaryWrite item, datareturn EmailMergeExternals("Wrte", data, item-1)end DictionaryWritefunction DictionaryAppendreturn EmailMergeExternals("Apnd")end DictionaryAppendon DictionaryRemove itemget EmailMergeExternals("Rmve", , item-1)end DictionaryRemovefunction DictionaryAdd delim, datareturn EmailMergeExternals("AddD", delim&numtochar(255)&data)end DictionaryAddon ShowAboutBoxget EmailMergeExternals("Abot")end ShowAboutBoxon AboutTimeoutget EmailMergeExternals("AbTo");end AboutTimeouton WaitForAboutget EmailMergeExternals("WaAb");end WaitForAboutfunction OpenFile filenamereturn EmailMergeExternals("Open", filename)end OpenFilefunction SaveFile filenamereturn EmailMergeExternals("Save", filename)end SaveFilefunction IsFileMakerProAvailablereturn EmailMergeExternals("FMPx")end IsFileMakerProAvailablefunction Receive10Records recordreturn EmailMergeExternals("Recv", , record)end Receive10Recordsfunction RetrieveRecord recordreturn EmailMergeExternals("Retr", , record)end RetrieveRecordfunction GetFieldNamesreturn EmailMergeExternals("Flds")end GetFieldNamesfunction GetAvailableClientsreturn EmailMergeExternals("Clnt")end GetAvailableClientsfunction GetClientEncodings clientreturn EmailMergeExternals("Encd", client)end GetClientEncodingsfunction GetClientAccounts clientset the cursor to watchreturn EmailMergeExternals("Acts", client)end GetClientAccountsfunction StartMerging clientplacefields truereturn EmailMergeExternals("Strt", client)end StartMergingfunction MergeDatabaseRecord recordreturn EmailMergeExternals("Merg", , record-1)end MergeDatabaseRecordon FinishMergingget EmailMergeExternals("Fnsh")end FinishMergingon doexportask file "Export database to :"if the result is not cancel thenput it into filenameopen file filenameput DictionaryItems() into itmsset the itemdelimiter to numtochar(255)repeat with l=1 to itmsget DictionaryRead(l)put empty into datarepeat with i=1 to the number of items in itput item i of it&tab after dataend repeatrepeatput offset(return, data) into oif o is 0 then exit repeatput numtochar(11) into char o of dataend repeatput return into the last char of datawrite data to file filenameif the last char of l is 0 then put "Exported "&l&" records" into bg fld "Help"end repeatset the itemdelimiter to commaclose file filenameresetpopuphelpend ifend doexporton cleanupset the topleft of cd window to 8, 48set the hilite of bg btn "popup" to falseset the hilite of cd btn "record" of cd "import" to trueput empty into bg fld "number"set the script of this bg to emptyget newmerge()go to cd "help"resetpopuphelpedomenu "compact stack"end cleanupfunction newmergeglobal _EMFdirtyif not closemerge() then return falseput false into _EMFdirtyemptymergereturn trueend newmergeon emptymergeglobal _EMIdata, _EMIfile, _EMFfile, _EMDfields, _EMSencoding, _EMSclient, _EMSaccountDictionaryClearput empty into _EMFfileput empty into _EMIdataput empty into _EMIfileput empty into cd fld "fields" of cd "import"put empty into cd fld "data" of cd "import"put empty into _EMDfieldsput empty into cd fld "field names" of cd "data"put empty into cd fld "data" of cd "data"put empty into cd fld "subject" of cd "message"put "«Email»" into cd fld "to" of cd "message"put empty into cd fld "cc" of cd "message"put empty into cd fld "bcc" of cd "message"put empty into cd fld "attachments" of cd "message"send mouseenter to cd btn "insert" of cd "message"send mouseleave to cd btn "insert" of cd "message"put "Dear «Name»," into cd fld "message" of cd "message"put empty into _EMSencodingput empty into _EMSclientput empty into _EMsaccountput empty into cd fld "preview" of cd "merge"send opencard to this cardend emptymergeon openmergeglobal _EMFfileanswer file "Select a merge to open:" of type "EmMe"if the result is not cancel then if newmerge() then openmergefile itend openmergeon openmergefile filenameglobal _EMFfile, _EMDfields, _EMSfields, _EMSsubjectglobal _EMSto, _EMScc, _EMSbccglobal _EMSattachments, _EMSencoding, _EMSclient, _EMSstuffit, _EMSmessageif OpenFile(filename) thenput filename into _EMFfileput _EMSfields into _EMDfieldsput _EMSsubject into cd fld "subject" of cd "message"put _EMSto into cd fld "to" of cd "message"put _EMScc into cd fld "cc" of cd "message"put _EMSbcc into cd fld "bcc" of cd "message"put _EMSattachments into cd fld "attachments" of cd "message"set the hilite of cd btn "stuffit compression" of cd "message" to _EMSstuffit is trueput _EMSmessage into cd fld "message" of cd "message"end ifemptysavesif the short name of this card is in "help import" then go to card "message"else send opencard to this cardend openmergefilefunction closemergeglobal _EMFdirtyif _EMFdirty thenanswer "Save the Email Merge configuration first?" with "Don't Save" or "Cancel" or "Yes"if it is cancel then return falseif it is yes then if not savemerge() then return falseend ifreturn trueend closemergefunction savemergeglobal _EMFdirty, _EMFfileif _EMFfile is empty then return savemergeas()elseplacefields falseget SaveFile(_EMFfile)if it then put false into _EMFdirtyemptysavesreturn itend ifend savemergeon placefields formergeglobal _EMDfields, _EMSfields, _EMSsubjectglobal _EMSto, _EMScc, _EMSbccglobal _EMSattachments, _EMSencoding, _EMSstuffit, _EMSmessage, _EMSaccountput _EMDfields into _EMSfieldsput cd fld "subject" of cd "message" into _EMSsubjectput cd fld "to" of cd "message" into _EMStoput cd fld "cc" of cd "message" into _EMSccput cd fld "bcc" of cd "message" into _EMSbccput cd fld "attachments" of cd "message" into _EMSattachmentsput the selectedtext of cd btn "encoding" of cd "message" into _EMSencodingput the hilite of cd btn "stuffit compression" of cd "message" into _EMSstuffitput cd fld "message" of cd "message" into _EMSmessageif formerge thenput replacemerge(_EMSsubject, "", "", "«§∆»") into _EMSsubjectput replacemerge(_EMSto, "", "", "«§∆»") into _EMStoput replacemerge(_EMScc, "", "", "«§∆»") into _EMSccput replacemerge(_EMSbcc, "", "", "«§∆»") into _EMSbccput replacemerge(_EMSattachments, "", "", "«§∆»") into _EMSattachmentsput replacemerge(_EMSmessage, "", "", "«§∆»") into _EMSmessageend ifend placefieldsfunction savemergeasglobal _EMFfileset the itemdelimiter to ":"get the last item of _EMFfileset the itemdelimiter to ","if it is empty then put "Untitled Merge" into itask file "Save merge as :" with itif the result is cancel then return falseput it into _EMFfilereturn savemerge()end savemergeason quitmergeif closemerge() then domenu "Quit HyperCard"end quitmergeon emptysavesglobal _EMSfields, _EMSsubjectglobal _EMSto, _EMScc, _EMSbccglobal _EMSattachments, _EMSencoding, _EMSstuffit, _EMSmessageput empty into _EMSfieldsput empty into _EMSsubjectput empty into _EMStoput empty into _EMSccput empty into _EMSbccput empty into _EMSattachmentsput empty into _EMSencodingput empty into _EMSstuffitput empty into _EMSmessageend emptysaveson clearmystylesset the textfont of char 1 to 99999 of the target to the textfont of the targetset the textsize of char 1 to 99999 of the target to the textsize of the targetset the textstyle of char 1 to 99999 of the target to the textstyle of the targetend clearmystyleson appleevent eventclass, eventidif eventclass is "aevt" and eventid is "odoc" thenrequest ae dataif there is not a file it then answer "Error in opening file"elseif newmerge(true) then openmergefile itend ifelsepass appleeventexit appleeventend ifend appleevent</script>
<background id="4216" file="background_4216.xml" name="" />
<card id="3850" file="card_3850.xml" marked="false" name="Help" owner="4216" />
<card id="2787" file="card_2787.xml" marked="false" name="Import" owner="4216" />
<card id="2864" file="card_2864.xml" marked="false" name="Data" owner="4216" />
<card id="3683" file="card_3683.xml" marked="false" name="Message" owner="4216" />
<card id="4984" file="card_4984.xml" marked="false" name="Merge" owner="4216" />
</stack>